package com.woniuxy.constant;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @Author: linKe
 * @Date: 2022/1/5 10:15
 * @FileName: JedisConstant
 * @version: 1.0
 * @Description: jedis 常量设置 读取配置文件，给静态成员变量赋值，用于jedis工具类静态构造中使用
 */
@Component
public class JedisConstant implements InitializingBean {

    @Value("${jedis.host}")
    private String host;

    public static String HOST;

    /**
     * InitializingBean bean声明周期初始化
     * afterPropertiesSet 参数赋值之后执行
     */
    @Override
    public void afterPropertiesSet() throws Exception {
        HOST=this.host;
    }
}

